import Layout from '@/layout'

// 动态路由
export const dynamicRoutes = [
    {
        path: '/',
        name: '/',
        component: Layout,
        redirect: '/home',
        meta: {
            isKeepAlive: true,
        },
        children: [
            {
                path: '/home',
                name: 'home',
                component: () => import('@/views/home'),
                meta: {
                    title: '首页',
                    isLink: '',
                    isHide: false,
                    isKeepAlive: true,
                    isAffix: true,
                    isIframe: false,
                    roles: ['admin', 'common'],
                    permissions: ['home'],
                    icon: 'dashboard'
                },
            },
            /** 组件 */
            {
                path: '/components',
                name: 'components',
                component: Layout,
                meta: {
                    title: '组件',
                    isLink: '',
                    isHide: false,
                    isKeepAlive: true,
                    isAffix: false,
                    isIframe: false,
                    roles: ['admin', 'common'],
                    permissions: ['components'],
                    icon: 'dashboard'
                },
                children: [
                    {
                        path: '/components/previewImage',
                        name: 'componentsPreviewImage',
                        meta: {
                            title: '预览图片',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            roles: ['admin', 'common'],
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/components/previewImage"),
                    },
                    {
                        path: '/components/htable',
                        name: 'componentsHtable',
                        meta: {
                            title: 'Htable',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            roles: ['admin', 'common'],
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/components/htable"),
                    }
                ]
            },
            /** Demo */
            {
                path: '/Demo',
                name: 'Demo',
                component: Layout,
                meta: {
                    title: '代码',
                    isLink: '',
                    isHide: false,
                    isKeepAlive: true,
                    isAffix: false,
                    isIframe: false,
                    roles: ['admin', 'common'],
                    permissions: ['components'],
                    icon: 'dashboard'
                },
                children: [
                    {
                        path: '/demo/page',
                        name: 'demoPage',
                        meta: {
                            title: 'page',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            roles: ['admin', 'common'],
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/demo/page"),
                    },
                    {
                        path: '/demo/validate',
                        name: 'demoValidate',
                        meta: {
                            title: 'validate',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            roles: ['admin', 'common'],
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/demo/validate"),
                    },
                    {
                        path: '/demo/dayjs',
                        name: 'demoDayjs',
                        meta: {
                            title: 'dayjs',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            roles: ['admin', 'common'],
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/demo/dayjs"),
                    }
                ]
            },
            /** echart */
            {
                path: '/echart',
                name: 'echart',
                component: Layout,
                meta: {
                    title: 'echart',
                    isLink: '',
                    isHide: false,
                    isKeepAlive: true,
                    isAffix: false,
                    isIframe: false,
                    roles: ['admin', 'common'],
                    permissions: ['components'],
                    icon: 'dashboard'
                },
                children: [
                    {
                        path: '/echart/line',
                        name: 'echartLine',
                        meta: {
                            title: '折线图',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            roles: ['admin', 'common'],
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/echart/line"),
                    },
                    {
                        path: '/echart/bar',
                        name: 'echartBar',
                        meta: {
                            title: '柱状图',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            roles: ['admin', 'common'],
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/echart/bar"),
                    },
                    {
                        path: '/echart/pie',
                        name: 'echartPie',
                        meta: {
                            title: '饼状图',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            roles: ['admin', 'common'],
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/echart/pie"),
                    }
                ]
            },
            // {
            //     path: '/multiLevel',
            //     name: 'multiLevel',
            //     component: Layout,
            //     meta: {
            //         title: '多级菜单',
            //         isLink: '',
            //         isHide: false,
            //         isKeepAlive: true,
            //         isAffix: false,
            //         isIframe: false,
            //         roles: ['admin', 'common'],
            //         icon: 'dashboard'
            //     },
            //     children: [
            //         {
            //             path: '/multiLevel/menu1',
            //             name: 'menu1',
            //             meta: {
            //                 title: 'menu1',
            //                 isLink: '',
            //                 isHide: false,
            //                 isKeepAlive: true,
            //                 isAffix: false,
            //                 isIframe: false,
            //                 roles: ['admin', 'common'],
            //                 icon: ''
            //             },
            //             component: () => import("@/views/multiLevel/menu1"),
            //             children: [
            //                 {
            //                     path: '/multiLevel/menu1/menu3',
            //                     name: 'menu3',
            //                     meta: {
            //                         title: 'menu3',
            //                         isLink: '',
            //                         isHide: false,
            //                         isKeepAlive: true,
            //                         isAffix: false,
            //                         isIframe: false,
            //                         roles: ['admin', 'common'],
            //                         icon: ''
            //                     },
            //                     component: () => import("@/views/multiLevel/menu3"),
            //                     children: [
            //                         {
            //                             path: '/multiLevel/menu1/menu3/menu5',
            //                             name: 'menu5',
            //                             meta: {
            //                                 title: 'menu5',
            //                                 isLink: '',
            //                                 isHide: false,
            //                                 isKeepAlive: true,
            //                                 isAffix: false,
            //                                 isIframe: false,
            //                                 roles: ['admin', 'common'],
            //                                 icon: ''
            //                             },
            //                             component: () => import("@/views/multiLevel/menu5"),
            //                         },
            //                         {
            //                             path: '/multiLevel/menu1/menu3/menu6',
            //                             name: 'menu6',
            //                             meta: {
            //                                 title: 'menu6',
            //                                 isLink: '',
            //                                 isHide: false,
            //                                 isKeepAlive: true,
            //                                 isAffix: false,
            //                                 isIframe: false,
            //                                 roles: ['admin', 'common'],
            //                                 icon: ''
            //                             },
            //                             component: () => import("@/views/multiLevel/menu6"),
            //                         },
            //                     ]
            //                 },
            //                 {
            //                     path: '/multiLevel/menu1/menu4',
            //                     name: 'menu4',
            //                     meta: {
            //                         title: 'menu4',
            //                         isLink: '',
            //                         isHide: false,
            //                         isKeepAlive: true,
            //                         isAffix: false,
            //                         isIframe: false,
            //                         roles: ['admin', 'common'],
            //                         icon: ''
            //                     },
            //                     component: () => import("@/views/multiLevel/menu4"),
            //                 },
            //             ]
            //         },
            //         {
            //             path: '/multiLevel/menu2',
            //             name: 'menu2',
            //             meta: {
            //                 title: 'menu2',
            //                 isLink: '',
            //                 isHide: false,
            //                 isKeepAlive: true,
            //                 isAffix: false,
            //                 isIframe: false,
            //                 roles: ['admin', 'common'],
            //                 icon: ''
            //             },
            //             component: () => import("@/views/multiLevel/menu2"),
            //         },
            //     ]
            // },
            // {
            //     path: '/link',
            //     name: 'layoutLinkView',
            //     component: Layout,
            //     meta: {
            //         title: '外接',
            //         isLink: 'https://element-plus.gitee.io/#/zh-CN/component/installation',
            //         isHide: false,
            //         isKeepAlive: false,
            //         isAffix: false,
            //         isIframe: false,
            //         roles: ['admin'],
            //         icon: '',
            //     },
            // },
        ]
    },

]

// 静态路由
export const staticRoutes = [
    {
        path: '/login',
        name: 'login',
        component: () => import("@/views/login"),
        meta: {
            title: '登录',
        }
    }
]

// 404、401界面
export const notFoundAndNoPower = [
    {
        path: '/:path(.*)*',
        name: 'notFound',
        component: () => import('@/views/error/404.vue'),
        meta: {
            title: '找不到此页面',
            isHide: true,
        },
    },
    {
        path: '/401',
        name: 'noPower',
        component: () => import('@/views/error/401.vue'),
        meta: {
            title: '没有权限',
            isHide: true,
        },
    },
]
